using System;
using LastFmLib.API20.Types;
using LastFmLib.General;

namespace StaffWarsFm.Questions
{
    public static class Util
    {
        public static AuthData GetAuthData()
        {
            return new AuthData(
               new MD5Hash("054f564f70f85c201ba41a23c98a3878", true, null),
               new MD5Hash("1249ef1a66c98eddd849634f5691a11d", true, null),
               null
           );
        }

        public static int Random(int max)
        {
            return new Random().Next(max - 1);
        }
    }

    public static class ObjectUtils
    {
        public static J Default<T,J>(this T obj, Func<T,J> get, J def)
        {
            if(obj != null)
            {
                return get(obj);
            }

            return def;
        }
    }
}
